{extend name="index/index"}

{block name="main"}


    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title">
            QBQ 角色列表
        </div>
        <ol class="am-breadcrumb">
            <li><a href="{:url('admin/index/index')}" class="am-icon-home">首页</a></li>
            <li class="am-active">角色信息</li>
            <li class="am-active">角色列表</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-code"></span> 角色列表
                </div>
                <div class="tpl-portlet-input tpl-fz-ml">
                    <div class="portlet-input input-small input-inline">
                        <form action="{:url('admin/role/doSearch')}" method="post">
                        <div class="input-icon right">
                            <i class="am-icon-search"></i>
                            <input type="text" class="form-control form-control-solid" name="search" placeholder="请输入搜索条件">
                        </div>
                        </form>
                    </div>
                </div>
            </div>
            <div class="tpl-block">
                <div class="am-g">
                    <div class="am-u-sm-12">
                            <table class="am-table am-table-striped am-table-hover table-main">
                                <thead>
                                <tr>
                                    <th class="table-id">ID</th>
                                    <th class="table-title">角色名</th>
                                    <th class="table-type">说明</th>
                                    <th class="table-author am-hide-sm-only">状态</th>
                                    <th class="table-author am-hide-sm-only">拥有权限</th>
                                    <th class="table-set">操作</th>
                                </tr>
                                </thead>
                                {if condition="$data === null"}
                                <tr>
                                    <td><h1>查无数据!</h1></td>
                                </tr>
                                {else /}
                                <tbody>
                                {volist name="data" key="k" id="v"}
                                <tr>
                                    <td>{$v['id']}</td>
                                    <td>{$v['name']}</td>
                                    <td>{$v['remark']}</td>
                                    <td class="status" data-id="{$v['id']}" data-status="{$v['status']}" style="color: #0ca3ea;cursor:pointer;">
                                        {switch name="v['status']"}
                                        {case value="1"}启用{/case}
                                        {case value="0"}禁用{/case}
                                        {/switch}
                                    </td>
                                    <td class="am-hide-sm-only">{$v['nname']}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a href="{:url('admin/role/edit', ['id'=>$v['id']])}" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 编辑</a>
                                                <button type="button" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only del-btn" data-id="{$v.id}"><span class="am-icon-trash-o"></span> 删除</button>
                                                <a href="{:url('admin/role/node', ['id'=>$v['id']])}" class="am-btn am-btn-default am-btn-xs am-text-primary am-hide-sm-only"><span class="am-icon-pencil-square-o"></span> 分配权限</a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                                {/if}
                            </table>
                            <div class="am-cf">

                                <div class="am-fr">
                                    {$page}
                                </div>
                            </div>
                            <hr>

                        </form>
                    </div>

                </div>
            </div>
            <div class="tpl-alert"></div>
        </div>

        <!--模态框-->
        <div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">删除角色</div>
                <div class="am-modal-bd">
                    你，确定要删除这个角色吗？
                </div>
                <div class="am-modal-footer">
                    <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                    <span class="am-modal-btn" data-am-modal-confirm>确定</span>
                </div>
            </div>
        </div>

        <script src="/static/admin/assets/js/jquery.min.js"></script>
        <script src="/static/admin/assets/js/amazeui.min.js"></script>
        <script src="/static/admin/assets/js/role.js"></script>


{/block}
    </div>

